<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>自方发布优化疫情防控二十条热</h2>
    <h2>广州:对目前在隔的次密者解除隔离四</h2>
    <h2>神-十四航天员在轨祝福人民空军</h2>
    <h2>奶茶店先说欢迎光临被封官方回应</h2>
    <h2>官方:严禁随意静默管理、封校停课</h2>
    <h2>高风险区外溢人员不再集中隔离</h2>
    <h2>不具备居家隔离条件者仍集中隔离</h2>
    <h2>女子简历被面试百撕毁公司回应</h2>
    <h2>赫尔松安东诺夫斯基大桥已被炸断</h2>
</body>
</html>
<script>
    // var count = 1
    function ajax(){
        var xhr = new XMLHttpRequest()
        xhr.open('get',`./${count}.json`)
        xhr.onreadystatechange = function(){
            if(xhr.readyState==4){
                console.log(JSON.parse(xhr.responseText))
            }
        }
        xhr.send()
    }
    var hEle = document.querySelectorAll('h2')
    for (let i = 0; i < hEle.length; i++) {
        hEle[i].onclick = function(){
            for (let j = 0; j < hEle.length; j++) {
                count = j
                ajax('get',`${count}.json`)
                hEle[j].innerHTML = ''
            }
            hEle[i].innerHTML= i
        }
        
    }
</script>
